package day05;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/14
 */
public class StringApi {
    public static void main(String[] args) {
        String s1 = "abchelloworld";
        String s2 = "abc";
        String s3 = "abcde";
        String s4 = "   qq   ";
        System.out.println(s1.charAt(1));
        System.out.println(s1.length());
        System.out.println(s1.indexOf(111));
        System.out.println(s1.lastIndexOf(111));
        System.out.println(s1.replace('a', 'b'));
        System.out.println(s1.replace("abc", "you"));
        System.out.println(s1.matches("^[a-zA-Z]+$"));
        System.out.println(s1.concat("cda"));
        System.out.println(s1.isEmpty());
        System.out.println(s2.equals(s3));
        System.out.println(s2.compareTo(s3));
        System.out.println(s4.trim());
    }
}
